package dao;

import org.mybatis.spring.SqlSessionTemplate;
import pojo.Blog;

import java.util.List;
import java.util.Map;

public class BlogMapperImpl implements BlogMapper {

    private SqlSessionTemplate sqlSession;

    public void setSqlSession(SqlSessionTemplate sqlSession){
        this.sqlSession = sqlSession;
    }


    public List<Blog> queryBlogIf(Map map) {
        BlogMapper mapper = sqlSession.getMapper(BlogMapper.class);
        return mapper.queryBlogIf(map);
    }

    public List<Blog> queryBlogChoose(Map map) {
        BlogMapper mapper = sqlSession.getMapper(BlogMapper.class);
        return mapper.queryBlogChoose(map);
    }

    public int updateBlog(Map map) {
        BlogMapper mapper = sqlSession.getMapper(BlogMapper.class);
        return mapper.updateBlog(map);
    }

    public List<Blog> queryBlogForeach(Map map) {
        BlogMapper mapper = sqlSession.getMapper(BlogMapper.class);
        return mapper.queryBlogForeach(map);
    }
}
